<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../../vue.js"></script>
</head>
<body>
    <div class="demo">
        <p v-for="i in demos">
            {{i.text}}
        </p>
        <input v-model="target" type="text">
        <button v-on:click="addText">添加元素</button>
    </div>

    <script type="text/javascript">
        new Vue({
            el:".demo",
            data:{
                demos:[
                    {text:"1"},
                    {text:"2"},
                    {text:"3"},
                    {text:"4"}
                ]
            },
            methods:{
                addText: function() {
                    this.demos = this.demos.push({text:"{{target}}"})
                }
            }
        })
    </script>
</body>
</html>